package com.leo.customer.entity.pojo

import com.leo.customer.entity.CreateTimeAndUpdateTime
import io.swagger.annotations.ApiModel
import java.time.LocalDateTime
import javax.persistence.Entity
import javax.validation.constraints.Future
import javax.validation.constraints.Min
import javax.validation.constraints.NotBlank

@ApiModel("招聘内容")
@Entity
data class Post(
        @field:NotBlank(message = "岗位名称不能为空")
        var name: String = "",
        /**
         * 0: 不限制,  1: 男性  2: 女性
         */
        var gender:Int = 0,
        @field:Min(value = 18, message = "需求年龄不得小于18岁")
        var ageLimitMin: Int = 18,
        var ageLimitMax: Int = 60,
        @field:Future(message = "结束时间不能早于当前时间")
        var endTime: LocalDateTime = LocalDateTime.now(),
        @field:Min(value = 1, message = "岗位数量不能少于1")
        var needCount: Int = 0,
        var startTime:LocalDateTime = LocalDateTime.now(),
        var organizeId:Int = 0
) : CreateTimeAndUpdateTime()
